<template>
	<div class="tab-nav">
		<div class="nav-item-image" :style="{ color: showData.fontColor, backgroundColor: showData.bgColor }">
			<div v-for="(item, index) in showData.shopList" :key="index" class="nav-item-image-li">
				<div style="text-align: center">
					<img :src="item.logoUrl" />
					<p class="text-overFlow-1" :style="{ color: showData.fontColor }">
						<span>{{ item.name }}</span>
					</p>
				</div>
			</div>
		</div>
	</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';

export default defineComponent({
	props: {
		showData: {
			type: Object as any,
			defult: {},
		},
	},
	setup() {
		return {};
	},
});
</script>

<style scoped lang="scss">
.tab-nav {
	.text-overFlow-1 {
		overflow: hidden;
		text-overflow: ellipsis;
		-o-text-overflow: ellipsis;
		-webkit-text-overflow: ellipsis;
		-moz-text-overflow: ellipsis;
		white-space: nowrap;
	}

	.nav-item-image {
		padding: 8px 15px 5px 16px;
		display: flex;
		padding-bottom: 10px;
		/* 不换行 */
		flex-wrap: nowrap;
		/* 启用横向滚动 */
		overflow-x: auto;
		width: 100%;
		.nav-item-image-li {
			display: inline-block;
			vertical-align: bottom;
			margin-top: 2px;
			width: 70px;
			img {
				transition: all 0.28s;
				width: 40px;
				height: 40px;
				// object-fit: cover;
				// object-position: center;
			}

			p {
				// width: 70px;
				color: #fff;
				font-size: 12px;
				text-align: center;
			}
		}
	}
}
</style>
